﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MailContentView.aspx.cs"
    Inherits="InformationSystem.WebSite.Module.MailMgr.MailContentView" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function callback() {
            parent.ResizeFrameHeight(Panel1.getHeight() + Panel4.getHeight());
            //parent.ResizeFrameHeight(ViewPort1.getHeight(500));
        }
        function reply() {
            var win = parent.Ext.getCmp('PFR');
            if (win)
                win.iframe.dom.contentWindow.location.href = "../NoticeMgr/CreateNew.aspx?m=mail&id=" + document.getElementById('hdnmailid').value;
        }

        function back() {
            var win = parent.Ext.getCmp('PFR');
            if (win)
                win.iframe.dom.contentWindow.history.back();
           
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server">
        <Listeners>
            <DocumentReady Fn="callback()" />
        </Listeners>
    </ext:ResourceManager>
    <ext:ObjectHolder ID="ObjHolder1" runat="server" />
    <ext:XTemplate ID="Tpl4" runat="server">
        <Html>
            <p>附件</p>
            <tpl for=".">
            <div style="margin-top: 8px;">
            <a href="MailAttachmentDownload.aspx?mailid={RefParentID}&fileid={FileID}">{UploadFileName}</a>
            </div>
				</tpl>
        </Html>
    </ext:XTemplate>
    <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
        <Items>
            <ext:Panel ID="Panel1" runat="server" Header="false" BodyBorder="false" Padding="0"
                Layout="FitLayout">
                <Items>
                    <ext:Panel ID="Panel2" runat="server" Title="" Cls="email-form" Frame="true" BodyStyle="10px 5px 5px;"
                        Layout="FitLayout">
                        <TopBar>
                            <ext:Toolbar ID="Toolbar1" runat="server">
                                <Items>
                                    <ext:Button runat="server" Text="返回">
                                        <Listeners>
                                            <Click Handler="back()" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button runat="server" Text="回复" Icon="Mail">
                                        <Listeners>
                                            <Click Handler="reply()" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarFill ID="ToolbarFill1" runat="server">
                                    </ext:ToolbarFill>
                                    <ext:Button runat="server" Text="打印" Icon="Printer">
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <Items>
                            <ext:FormPanel ID="FormPanel1" runat="server" BaseCls="x-plain" Border="true" Padding="5"
                                LabelWidth="80">
                                <Items>
                                    <ext:Label ID="lbSubject" runat="server" FieldLabel="主题" Text="">
                                    </ext:Label>
                                    <ext:Label ID="lbSender" runat="server" FieldLabel="发件人" Text="">
                                    </ext:Label>
                                    <ext:Label ID="lbSendTime" runat="server" FieldLabel="时间" Text="">
                                    </ext:Label>
                                    <ext:Label ID="lbRecvUser" runat="server" FieldLabel="收件人" Text="">
                                    </ext:Label>
                                    <ext:HtmlEditor ID="txtContent" runat="server" ReadOnly="true" EnableFont="false"
                                        EnableColors="false" EnableFontSize="false" EnableFormat="false" EnableSourceEdit="false"
                                        HideLabel="true" EnableAlignments="false" EnableLists="false" EnableLinks="false"
                                        AnchorHorizontal="100%">
                                       
                                    </ext:HtmlEditor>
                                    
                                    <ext:Panel ID="Panel4" runat="server" BodyStyle="background-color:#F8F8F8; padding:5px; border:dotted 1px gray;"
                                        AutoHeight="true">
                                        <Listeners>
                                            <Render Handler="#{Tpl4}.overwrite(this.body, #{ObjHolder1}.Attachments);" />
                                        </Listeners>
                                    </ext:Panel>
                                </Items>
                            </ext:FormPanel>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Viewport>
    <input type="hidden" runat="server"  id="hdnmailid" name="hdnmailid"  />
    </form>
</body>
</html>
